++offset;
/* Find end of next word */
- while (offset < len && !attrs[offset].is_word_end)
- ++offset;
+ while (offset < len)
+ {
+ if (attrs[offset].is_word_end)
+ {
+ *found_offset = offset;
+ return TRUE;
+ }
- *found_offset = offset;
+ ++offset;
+ }
- return offset < len;
+ return FALSE;
}
static gboolean
--offset;
/* Find start of prev word */
- while (offset >= 0 && !attrs[offset].is_word_start)
- --offset;
+ while (offset >= 0)
+ {
+ if (attrs[offset].is_word_start)
+ {
+ *found_offset = offset;
+ return TRUE;
+ }
- *found_offset = offset;
+ --offset;
+ }
- return offset >= 0;
+ return FALSE;
}
static gboolean
++offset;
/* Find end of next sentence */
- while (offset < len && !attrs[offset].is_sentence_end)
- ++offset;
+ while (offset < len)
+ {
+ if (attrs[offset].is_sentence_end)
+ {
+ *found_offset = offset;
+ return TRUE;
+ }
- *found_offset = offset;
+ ++offset;
+ }
- return offset < len;
+ return FALSE;
}
static gboolean
--offset;
/* Find start of prev sentence */
- while (offset >= 0 && !attrs[offset].is_sentence_start)
- --offset;
+ while (offset >= 0)
+ {
+ if (attrs[offset].is_sentence_start)
+ {
+ *found_offset = offset;
+ return TRUE;
+ }
- *found_offset = offset;
+ --offset;
+ }
- return offset >= 0;
+ return FALSE;
}
static gboolean
if (!already_moved_initially)
++offset;
- while (offset < len && !attrs[offset].is_cursor_position)
- ++offset;
+ while (offset < len)
+ {
+ if (attrs[offset].is_cursor_position)
+ {
+ *found_offset = offset;
+ return TRUE;
+ }
- *found_offset = offset;
+ ++offset;
+ }
- return offset < len;
+ return FALSE;
}
static gboolean
if (!already_moved_initially)
--offset;
- while (offset > 0 && !attrs[offset].is_cursor_position)
- --offset;
+ while (offset >= 0)
+ {
+ if (attrs[offset].is_cursor_position)
+ {
+ *found_offset = offset;
+ return TRUE;
+ }
- *found_offset = offset;
+ --offset;
+ }
- return offset >= 0;
+ return FALSE;
}
static gboolean